package com.kgc.Work04;

public class Student implements Comparable {
	private int num;
	private String name;
	private int age;
	private double score;
	    public Student() {
		
	}
		public Student(int num, String name, int age, double score) {
		this.num=num;
		this.name=name;
		this.age=age;
		this.score=score;
	}
		public int getNum() {
			return num;
		}
		public void setNum(int num) {
			this.num = num;
		}
		public String getName() {
			return name;
		}
		public void setName(String name) {
			this.name = name;
		}
		public int getAge() {
			return age;
		}
		public void setAge(int age) {
			this.age = age;
		}
		public double getScore() {
			return score;
		}
		public void setScore(double score) {
			this.score = score;
		}
		@Override
		public int compareTo(Object obj) {
			Student stu=(Student)obj;
			if (this.getScore()>stu.getScore()) {
				return -1;
			}else {
				return 1;
			}
		}
	
}
